package com.jielihaofeng.springboot.websocket.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

import javax.websocket.server.ServerEndpoint;

/**
 * @author Johnnie Wind
 * @description
 * @date 2021/4/2 15:21
 */
@Configuration
public class WebSocketStompConfig {

    //这个bean的注册,用于扫描带有 @ServerEndpoint 的注解成为 websocket ,如果你使用外置的tomcat就不需要该配置文件
    @Bean
    public ServerEndpointExporter serverEndpointExporter(){
        return new ServerEndpointExporter();
    }

}
